package cn.demoncat.util.pdf.itextpdf.entity;

import java.time.LocalDateTime;

import com.itextpdf.signatures.PdfPKCS7;

import cn.demoncat.util.lang.LocalDateUtil;

/**
 * PDF签名数据
 * 
 * @author 延晓磊
 *
 * @since 2020年6月6日
 */
public class PdfSignData {

	/**
	 * 验证结果
	 */
	private boolean verifie;

    /**
     * 签名域
     */
    private String signName;

    /**
     * 签名信息 - 原因
     */
    private String reason;

    /**
     * 签名信息 - 位置
     */
    private String location;

    /**
     * 签名算法
     */
    private String algorithm;
    /**
     * 签名时间
     */
    private LocalDateTime signTime;
    
    public PdfSignData() {
		super();
	}

	/**
     * 转换
     * 
     * @param data
     * 
     * @author 延晓磊
     *
     * @since 2020年6月6日
     */
    public PdfSignData(PdfPKCS7 data, boolean verifie) {
    	super();
    	this.verifie = verifie;
    	this.algorithm = data.getDigestAlgorithm();
    	this.location = data.getLocation();
    	this.reason = data.getReason();
    	this.signName = data.getSignName();
    	this.signTime = LocalDateUtil.toLocalDateTime(data.getSignDate().getTimeInMillis());
    }

	public boolean isVerifie() {
		return verifie;
	}

	public void setVerifie(boolean verifie) {
		this.verifie = verifie;
	}

	public String getSignName() {
		return signName;
	}

	public void setSignName(String signName) {
		this.signName = signName;
	}

	public String getReason() {
		return reason;
	}

	public void setReason(String reason) {
		this.reason = reason;
	}

	public String getLocation() {
		return location;
	}

	public void setLocation(String location) {
		this.location = location;
	}

	public String getAlgorithm() {
		return algorithm;
	}

	public void setAlgorithm(String algorithm) {
		this.algorithm = algorithm;
	}

	public LocalDateTime getSignTime() {
		return signTime;
	}

	public void setSignTime(LocalDateTime signTime) {
		this.signTime = signTime;
	}
    
    
}
